x:=1+2*3 // 2 will be multiplied with 3, result will be added to 1 and result // will be copied to x. x-=1<<2*3 // 1 will be shifted by 2 to the left, result will be multiplied by 3 // and result will be subtracted from x.
Operator | Name | Priority | Comment | |||
---|---|---|---|---|---|---|
D | C | A | E | See OPTions. | ||
||, OR | Logical OR | 1 | 1 | 1 | 1 | |
&&, AND | Logical AND | 1 | 1 | 1 | 1 | |
NOR | Logical NOR | 1 | 1 | 1 | 1 | (a NOR b) equals to Not(a OR b) |
NAND | Logical NAND | 1 | 1 | 1 | 1 | (a NAND b) equals to Not(a AND b) |
=, <>, >, <, >=, <= | Conditions | 2 | 2 | 2 | 2 | |
+ | Plus | 3 | 5 | 3 | 3 | |
- | Minus | 3 | 5 | 3 | 3 | |
* | Multiply | 4 | 6 | 5 | 3 | |
/ | Divide | 4 | 6 | 5 | 3 | |
\ | Modulo | 4 | 6 | 5 | 3 | Floats only with fpu. See NOFPU |
| | Bit OR | 5 | 4 | 4 | 3 | Possible only with integers |
! | Bit EOR | 5 | 4 | 4 | 3 | Possible only with integers |
& | Bit AND | 5 | 4 | 4 | 3 | Possible only with integers |
<< | Shift Left | 6 | 3 | 6 | 3 | Possible only with integers |
>> | Shift Right | 6 | 3 | 6 | 3 | Possible only with integers |
<| or |< | Rotate Left | 6 | - | - | - | Possible only with integers |
>| or |> | Rotate Right | 6 | - | - | - | Possible only with integers |
Operator | Name | Comment |
---|---|---|
:= | Copy | |
+= | Add | |
-= | Subtract | |
*= | Multiply | |
/= | Divide | |
\= | Modulo | Floats only with fpu. See NOFPU |
|= | Bit OR | Possible only with integers |
!= | Bit EOR | Possible only with integers |
&= | Bit AND | Possible only with integers |
~= | Copy NOTed | Possible only with integers |
<<= | Shift Left | Possible only with integers |
>>= | Shift Right | Possible only with integers |
<|= or |<= | Rotate Left | Possible only with integers |
>|= or |>= | Rotate Right | Possible only with integers |
:=: | Swap |
DEF a,b,c a:=10 // a=10 b:=a\4 // b=2 c:=a>>2 // c=2 a+=b+3*c // a=18 a:=:c // c=18, a=2 b:=a+3+c-=12 // c=6, b=11